<?php
	session_start();
	if(!array_key_exists("role", $_SESSION) || $_SESSION['role'] != "admin"){
		header("Location: /index.php");
		exit;
	}
	
	$conn = mysql_connect("", "piedu_user", "q&&^%@8ezO8+");
	mysql_select_db("piedu_db");
	
	$sql = "SELECT * FROM transactions WHERE id = {$_GET['id']}";
	$query = mysql_query($sql, $conn);
	if(mysql_num_rows($query) == 0){
		header("Location: transactions.php?action=notfound");
		exit;
	}
	$transaction = mysql_fetch_assoc($query);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pie Education | Manage Transactions</title>
<Meta name="Author" content="Rob Keller">
<Meta name="Publisher" content="Aaron Aceves">
<Meta name="Robots" content="NOINDEX,NOFOLLOW">
<Meta name="Content-Language" content="English">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="../css/style.css" />
<style type="text/css">
.right {
	text-align: right;
}
.right {
	text-align: right;
}
</style>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="80" bgcolor="#FF8C00" align="center"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="index.php"><img src="../images/logo.png" alt="Return to Index" width="250" height="70" border="0" title="pie.edu an E-Learning Network" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#000000" align="center"><a href="index.php" class="global-nav-menu" style="color:#FFF">Home </a><a href="coupons.php" class="global-nav-menu" style="color:#FFF">Manage Coupons </a><a href="promotions.php" class="global-nav-menu" style="color:#FFF">Manage Promotions </a><a href="items.php" class="global-nav-menu" style="color:#FFF">Manage Items</a><a href="manage_orders.php" class="global-nav-menu" style="color:#FFF">Manage Orders</a><a href="transactions.php" class="global-nav-menu" style="color:#FFF">Transactions Details</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="/logout.php" class="global-nav-menu" style="color:#FFF">Logout</a></td>
  </tr>
  <tr>
    <td height="500" bgcolor="#FFFFFF"><table width="980" border="0" align="center" cellpadding="4" cellspacing="4">
      <tr>
        <td align="right" style="color:#FFF">&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right" style="color:#FFF">&nbsp;</td>
        <td align="right"><a href="transactions.php"><strong>Return to Transactions</strong></a></td>
      </tr>
      <tr>
        <td width="20%" align="right" bgcolor="#000000" style="color:#FFF"><strong>Order Number</strong></td>
        <td width="30%"><?php echo $transaction['order_number']; ?></td>
        <td width="20%" align="right" bgcolor="#000000" style="color:#FFF"><strong>Buyer</strong></td>
        <td width="30%"><?php echo $transaction['username']; ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#000000" style="color:#FFF"><strong>Items Quantity</strong></td>
        <td><?php echo $transaction['quantity']; ?></td>
        <td align="right" bgcolor="#000000" style="color:#FFF"><strong>Shipping Cost</strong></td>
        <td><?php echo $transaction['shipping']; ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#000000" style="color:#FFF"><strong>Tax</strong></td>
        <td><?php echo $transaction['tax']; ?></td>
        <td align="right" bgcolor="#000000" style="color:#FFF"><strong>Subtotal</strong></td>
        <td><?php echo $transaction['subtotal']; ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#000000" style="color:#FFF"><strong>Total Cost</strong></td>
        <td><?php echo $transaction['total_cost']; ?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right"><strong><a href="transactions.php">Return to Transactions</a></strong></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="80" bgcolor="#FF9933" align="center"><a href="../index.php" class="bottom-general-menu" style="color:#FFF">Home</a> <a href="../platform.php" class="bottom-general-menu" style="color:#FFF">Platform</a> <a href="../piephone.php" class="bottom-general-menu" style="color:#FFF">Pie Phone</a> <a href="../company_training.php" class="bottom-general-menu" style="color:#FFF">Company Training</a> <a href="../jobs.php" class="bottom-general-menu" style="color:#FFF">Jobs</a> <a href="../press.php" class="bottom-general-menu" style="color:#FFF">Press</a> <a href="../community/" class="bottom-general-menu" style="color:#FFF">Community</a> <a href="../mobile.php" class="bottom-general-menu" style="color:#FFF">Mobile</a> <a href="support/" class="bottom-general-menu" style="color:#FFF">Help</a> <a href="../blog/" class="bottom-general-menu" style="color:#FFF">Blogs</a> <a href="../forums/" class="bottom-general-menu" style="color:#FFF">Forums</a><a href="../about.php" class="bottom-general-menu" style="color:#FFF">About</a> <a href="../terms.html" class="bottom-general-menu" style="color:#FFF">Terms of Use</a> <a href="../privacy.html" class="bottom-general-menu" style="color:#FFF">Privacy Policy</a> <a href="../contact-us.php" class="bottom-general-menu" style="color:#FFF">Contact Us</a></td>
  </tr>
</table>
</body>
</html>